#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

struct Guest
{
	int arrival;
	int leave;
};

Guest g[10];


bool cmp(const int & i, const int & j)
{
	return abs(i) < abs(j);
}

void maximum_guest()
{
	for (int i = 0; i < 10; i++)
	{
		g[i].arrival = i;
		g[i].leave = i - 1;
	}
	vector<int> timeVec;
	for (int i = 0; i < 10; ++i)
	{
		timeVec.push_back(+g[i].arrival);
		timeVec.push_back(-g[i].leave);
	}
	sort(timeVec.begin(), timeVec.end(), cmp);			//排序 STL函数
	
	int n = 0, maximum = 0;
	for (int i = 0; i < timeVec.size(); ++i)
	{
		if (timeVec[i] > 0)
		{
			n++;
		}
		else
		{
			n--;
		}
		maximum = max(maximum, n);			           //STL函数
		cout << "the timeVec's " << i << " is " << timeVec[i] << endl;
	}
	cout << "the time that people most is : " << maximum << " people" << endl;

	
}

int main(int argc, char **argv)
{
	maximum_guest();
}
